/*
 * @Author: 赵天天
 * @Date: 2019-04-02 16:10:27
 * @LastEditors: 赵天天
 * @LastEditTime: 2019-05-20 15:04:40
 * @email: dayday_1996@163.com
 * @Descripttion: 事件威胁分布
 */
export default function drawCircle (circledata) {
  var option = {
    tooltip: {
      trigger: 'item',
      formatter: function (param) {
        return param.marker + param.name + ' ：' + param.percent + '%'
      },
      textStyle: {
        color: '#ffffff',
        fontFamily: '宋体',
        fontSize: 12
      }
    },
    legend: {
      orient: 'vertical',
      x: 'right',
      data: ['低危', '中危', '高危', '严重'],
      y: '70',
      textStyle: {
        color: '#5c6781',
        fontFamily: '宋体'
      },
      // top: '70px',
      borderRadius: [5, 5, 5, 5],
      itemWidth: '10',
      itemHeight: '10',
      icon: 'circle'
    },
    color: ['#03BC78', '#ffc833', '#ff9933', '#ff6633', '#ff3333'],
    series: [
      {
        name: '告警等级',
        type: 'pie',
        radius: ['50%', '70%'],
        avoidLabelOverlap: false,
        label: {
          normal: {
            show: false,
            position: 'center',
            //  '{c|{c}}', c 类名 c 变量
            formatter: [
              '{c|{c}}',
              '{b|{b}}'
            ].join('\n'),
            rich: {
              c: {
                fontSize: '32',
                color: '#3A3D46'
              },
              b: {
                fontSize: '12',
                color: '#5c6781'
              }
            }
          },
          emphasis: {
            show: true,
            textStyle: {
              fontSize: '30',
              fontWeight: 'bold'
            }
          }
        },
        labelLine: {
          normal: {
            show: false
          }
        },
        data: circledata
      }
    ]
  }
  return option
}
